#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int* twoSum(int* nums, int numsSize, int target, int* returnSize) {
    int key = sizeof(nums) / sizeof(int);
    for (int i = 0; i < key; i++) {
        for (int j = i + 1; j < key; j++) {
            if (nums[i] + nums[j] == target) {
                returnSize = malloc(2 * sizeof(int));
                returnSize[0] = i;
                returnSize[1] = j;
                return returnSize;
            }
        }
    }
    return NULL;
}
int main() {
    int a[] = { 2,7,11,15 };
    int* b = malloc(2 * sizeof(int));
    int c = sizeof(a) / sizeof(int);
    int *d=twoSum(a, c, 9, b);
    if (d != NULL) {
        for (int i = 0; i < 2; i++) {
            printf("%d ", d[i]);
        }
    }
}